import Vue from 'vue'
import axios from 'axios'
import App from './App.vue'
import router from './router'

Vue.prototype.$axios = axios
Vue.config.productionTip = false

router.beforeEach((to, from, next) => {
  let num = sessionStorage.getItem("token");

  console.log(num);
  if (to.name == 'riman' || to.name == 'all') {
    if (num != null) {
      next()
    } else {

      next({
        name: 'my'
      })
    }
  } else {
    next()
  }
})

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')